//
//  SISSJsonRequestNetworkingManager+Login.m
//  SISSAPP
//
//  Created by 袁应荣 on 2018/12/3.
//  Copyright © 2018年 优房网. All rights reserved.
//

#import "SISSJsonRequestNetworkingManager+Login.h"

@implementation SISSJsonRequestNetworkingManager (Login)

// 1.1 登录
- (void)loginWithParameters:(NSDictionary *)parameters successBlock:(void (^)(id _Nonnull))successBlock failed:(void (^)(NSError * _Nonnull))failedBlock {
    [kJsonRequestNetworkingManager POSTWithURLString:URL_LOGIN parameters:parameters success:^(id responseObject) {
        
        NSLog(@"%@",responseObject);
        if (successBlock) {
            successBlock(responseObject);
        }
        
    } failure:^(NSError *error) {
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 1.4 登录后获取人员相关信息
- (void)requestLoginPersonInfoWithName:(NSString *)name successBlock:(void (^)(id _Nonnull))successBlock failed:(void (^)(NSError * _Nonnull))failedBlock {
    NSDictionary *parameters = @{@"name": name,
                                 @"version" : kBundleVersionStr
                                 };
    [kJsonRequestNetworkingManager GETWithURLString:URL_LOGIN_PERSON_INFO parameters:parameters success:^(id responseObject) {
        
        NSLog(@"%@",responseObject);
        if (successBlock) {
            successBlock(responseObject);
        }
        
    } failure:^(NSError *error) {
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

@end
